package app.ep1.test;

import android.test.ActivityInstrumentationTestCase2;
import android.widget.Spinner;
import app.ep1.bandejoes.BandejoesActivity;
import app.ep1.R;

public class BandejoesValidation extends
		ActivityInstrumentationTestCase2<BandejoesActivity> {
	public BandejoesValidation() {
		super("app.ep1.bandejoes", BandejoesActivity.class);
	}

	@Override
	protected void setUp() throws Exception {
		super.setUp();
	}

	public void testMudaSpinner() throws Throwable {
		BandejoesActivity bandejoesActivity = getActivity();

		final Spinner spinner = (Spinner) bandejoesActivity
				.findViewById(R.id.spinner);

		long selecionadoAntes = spinner.getSelectedItemId();

		runTestOnUiThread(new Runnable() {
			@Override
			public void run() {
				spinner.setSelection(2);
			}
		});

		assertNotSame(selecionadoAntes, spinner.getSelectedItemId());
	}
}
